unit Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, BaseGrid, AdvGrid, StdCtrls, Mask, RzEdit, RzCmboBx,
  RzBorder, RzCommon, AdvSelectors, asgcombo, ColorCombo;

type
  TForm1 = class(TForm)
    AdvGrid: TAdvStringGrid;
    Button1: TButton;
    RzCustomColors1: TRzCustomColors;
    ColorDialog1: TColorDialog;
    Button2: TButton;
    RzColorEdit1: TRzColorEdit;
    Button3: TButton;
    Button4: TButton;
    procedure FormShow(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses
  Unit2,Unit3;

{$R *.dfm}

procedure TForm1.FormShow(Sender: TObject);
begin
  with advgrid do
  begin
    ColCount:=20;
    ColumnHeaders.Clear;
    ColumnHeaders.Delimiter:=',';
    ColumnHeaders.DelimitedText:='1,2,3,4,5,6,7,8';

    ColCount:=ColumnHeaders.Count;
  end;  
end;

procedure TForm1.Button1Click(Sender: TObject);
  function showmsg(avalue:Variant):Integer;
  begin
    ShowMessage(VarToStr(avalue));
  end;
begin
   {ShowMessageFmt('colcount:%D',[AdvGrid.ColCount]);
  AdvGrid.HideColumn(4);
  if AdvGrid.IsHiddenColumn(4) then
  begin
    ShowMessage('text');
  end;}


  AdvGrid.AddComment(4,4,'helloworld');

  AdvGrid.AddCheckBox(1,1,False,False);
  AdvGrid.Cells[1,1]:='True';
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  if ColorDialog1.Execute then
  begin
    Color:=ColorDialog1.Color;
    //ColorToString()
    Caption:=ColorToString(ColorDialog1.Color);

    ShowMessage(ColorToString(AdvGrid.Colors[1,1]));
  end;  
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
  Form2:=TForm2.Create(nil);
  Form2.Show;
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
  Form2:=TForm2.Create(nil);
  Form2.ShowModal;
end;

end.
